import BaseMultiTabMinix from './BaseMultiTabMinix'

import clone from 'clone'

export default {
  mixins: [BaseMultiTabMinix],
  methods: {
    handleRouteChange (page) {
      // 如pages中存在与当前$route相同path的页面，则替换
      const samePageIndex = this.pages.findIndex(p => p.path == page.path)

      if (samePageIndex != -1) {
        this.pages.splice(samePageIndex, 1, page)
      } else {
        this.pages.push(page)
      }
    }
  }
}